set the member of sprite the spriteNum of me to member the downMember of me
set the button_active of me to 1
end
on mouseUp me
set the member of sprite the spriteNum of me to member the upMember of me
set the button_active of me to 0
updateStage()
call(myAction, script scriptLoc)
end
on mouseEnter me
if the button_active of me then
set the member of sprite the spriteNum of me to member the downMember of me
end if
end
on mouseLeave me
if the button_active of me then
set the member of sprite the spriteNum of me to member the upMember of me
end if
end
on mouseUpOutSide me
set the button_active of me to 0
end
on beginSprite me
set the upMember of me to the member of sprite the spriteNum of me
set the button_active of me to 0
end
on endSprite me
end
on getPropertyDescriptionList
if the currentSpriteNum = 0 then
set memdefault to 0
else
set memref to the member of sprite the currentSpriteNum
set castLibNum to the castLibNum of memref
set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum
end if
set p_list to [#downMember: [#comment: "Down state member:", #format: #graphic, #default: memdefault], #myAction: [#comment: "Type a handler for this button:", #format: #symbol, #default: #empty], #scriptLoc: [#comment: "Which is in movie script:", #format: #script, #default: EMPTY]]
return p_list
end
on getBehaviorDescription
return "Makes a sprite work as a pushbutton with down state and mouse tracking. The sprite's initial castmember represents the button's normal state." & RETURN & "PARAMETERS:" & RETURN & "• Down member - Choose the cast member to display when the button is pressed. The default value is the cast member immedietly following the sprite's current cast member." & RETURN & "• Action - the handler to activate" & RETURN & "• Movie script - location of the handler. This way the code gets compiled, avoiding the 'do' command."